package com.sx.pipeline.ui.bank

import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.sx.pipeline.BR
import com.sx.pipeline.R
import com.sx.pipeline.app.base.CYDataBindingBaseActivity
import com.sx.pipeline.arouth.RoutePath
import com.sx.pipeline.databinding.ActBankAddBinding


/**
 * @Author: YY
 * @Date: 2022/4/5
 * @Description: 添加银行卡
 */
@Route(path = RoutePath.Wallet.BANK_CARD_ADD)
class BankAddActivity : CYDataBindingBaseActivity<ActBankAddBinding, BankVM>(R.layout.act_bank_add),
    View.OnClickListener {

    override fun initData() {
        mBinding.setVariable(BR.onClick, this)
        mBinding.titleBar.leftView.setOnClickListener {
            finish()
        }
    }

    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.tv_submit -> {
                mViewModel.addBankCard(
                    mBinding.tvUsername.text.toString(),
                    mBinding.etIdentityNum.text.toString(),
                    mBinding.etBankAccount.text.toString(),
                    mBinding.etBank.text.toString(),
                    mBinding.etPhone.text.toString()
                )
            }
        }
    }

}